/**
 * @file penguin_fsm.cpp
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2022-08-03
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#include "penguin_fsm.h"
#include "penguin.h"

void Eatting::react(const Doudou&, FullControl& f) noexcept {
  // 获取penguin对象，并调用其方法
  f.context()->a();

  // 状态流转
  f.changeTo<BeatDoudou>();
}

void Sleep::react(const Sunrise&, FullControl& f) noexcept {
  f.context()->a();

  // 状态流转
  f.changeTo<Eatting>();
}

void BeatDoudou::react(const Sunset&, FullControl& f) noexcept {
  f.context()->a();

  // 状态流转
  f.changeTo<Sleep>();
}

void FSM_Logger::recordTransition(Context& ctx, const StateID origin,
                                  const TransitionType,
                                  const StateID target) noexcept {
  std::cout << stateName(origin) << " -> " << stateName(target) << "\n";

}